<?php
namespace App\Params\H5;
use App\Params\Param;
/**
 * 评论列表查询参数
 *
 * @author: WangBin
 * @date: 2021/7/26
 * @mail: <849850352@qq.com>
 */
class CommentListParams extends Param
{
    public $goods_id;
    public $page;
    public $page_size = 20;
    public $customer_id;
    public $product_id;
    public $score_type = -1;

    public function rules()
    {
        return [
            'goods_id' => 'required|integer',
            'page' => 'integer|min:1',
            'page_size' => 'integer|min:1',
            'customer_id' => 'nullable|integer',
            'product_id' => 'nullable|integer',
            'score_type' => 'nullable|integer'
        ];
    }

    /**
     * @return int
     */
    public function getScoreType(): int
    {
        return $this->score_type;
    }

    /**
     * @param int $score_type
     */
    public function setScoreType(int $score_type): void
    {
        $this->score_type = $score_type;
    }

    /**
     * @return mixed
     */
    public function getGoodsId()
    {
        return $this->goods_id;
    }

    /**
     * @param mixed $goods_id
     */
    public function setGoodsId($goods_id): void
    {
        $this->goods_id = $goods_id;
    }

    /**
     * @return mixed
     */
    public function getPage()
    {
        return $this->page ? -- $this->page : 0;
    }

    /**
     * @param mixed $page
     */
    public function setPage($page): void
    {
        $this->page = $page;
    }

    /**
     * @return mixed
     */
    public function getPageSize()
    {
        return $this->page_size;
    }

    /**
     * @param mixed $page_size
     */
    public function setPageSize($page_size): void
    {
        $this->page_size = $page_size;
    }

    /**
     * @return mixed
     */
    public function getCustomerId()
    {
        return $this->customer_id;
    }

    /**
     * @param mixed $customer_id
     */
    public function setCustomerId($customer_id): void
    {
        $this->customer_id = $customer_id;
    }

    /**
     * @return int
     */
    public function getProductId(): int
    {
        return $this->product_id;
    }

    /**
     * @param int $product_id
     */
    public function setProductId(int $product_id): void
    {
        $this->product_id = $product_id;
    }
}
